<?php
	error_reporting(E_ALL - E_NOTICE);
	$pwd = $_POST['pwd'];
	
	if ($pwd == 'hexie4u'){
		if(isset($_POST['config'])){
			$config = get_magic_quotes_gpc() ? stripslashes($_POST['config']) : $_POST['config'];
			unlink('HexieList.lst');
			$f = fopen('HexieList.lst','w');
			fwrite($f,$config);
			fclose($f);
			?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-cn" dir="ltr">
<head><title>Namiko Web Administration</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body><h2>Namiko HX</h2><form action="" method="post"><b>已更新</b> <input type="hidden" name="pwd" value="<?php echo $pwd ?>" /><input type="submit" value="返回" /></form></body></html><?php
		}else{
			?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-cn" dir="ltr">
<head><title>Namiko Web Administration</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body><h2>Namiko HX</h2><form action="" method="post"><input type="hidden" name="pwd" value="<?php echo $pwd ?>" /><textarea style="width: 100%" rows="30" name="config"><?php echo file_get_contents('HexieList.lst'); ?></textarea><br /><input type="submit" value="编辑" /></form></body></html><?php
		}
	}else{
		?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-cn" dir="ltr">
<head><title>Namiko Web Administration</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body><h2>Namiko HX入口</h2><form action="" method="post"><label for="pwd">密码</label><input type="password" name="pwd" id="pwd" size="8" /><input type="submit" value="进入" /></form></body></html><?php
	}
?>